﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Estadisticas.aspx.cs" Inherits="patriota_Estadisticas" %>







<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>.:: Estadisticas ::.</title>
     <link rel="stylesheet" href="styles.css" type="text/css" />
</head>
<body>
  <div id="wrap">
	<div id="header"  >
		<div id="header-text"  >
			&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
             <br />
            <br />
            
		</div>
	</div>
    <div id="navigation">
		<ul>
		
			<!-- top navigation use selected class for selected item -->
			<li><a href="MultipleSearch.aspx">Inicio</a></li>		
            <li><a href="NewPadron.aspx">Nuevo</a></li>		
            <li><a href="Estadisticas.aspx">Estadisticas</a></li>		
           	<li><a href="../admin/logout.aspx">Salir</a></li>
		</ul>
	</div>
	
	<div id="content">
	    <!-- left hand main content -->
		<div id="page">
        <form id="form1" runat="server">
         <table  align="center">
         <tr>
        <td>
            <img src="images/energy.jpg" height="110" width="400" />
        </td>
       
        <td>
            <table>
            <tr>
                <th>Empadronados</th>
                <th>Votos</th>
                <th>Pendientes</th>
            </tr>
            <tr>
                <td align="center"><asp:Label ID="lb_empadronado" runat="server" Text="0"></asp:Label></td>
                <td align="center"><asp:Label ID="lb_voto" runat="server" Text="0"></asp:Label></td>
                <td align="center"><asp:Label ID="lb_pendiente" runat="server" Text="0"></asp:Label></td>
            </tr>
            </table>
            
        </td>
    </tr>
    <tr>
        <td valign="top">
            <asp:GridView ID="gv_centros" runat="server" AutoGenerateColumns="False" 
                Width="500px">
                <AlternatingRowStyle BackColor="#F5E3CB" />
                <Columns>
                    <asp:TemplateField HeaderText="CODIGO"><ItemTemplate><asp:Label ID="lb_padron" runat="server" Text='<%# Eval("cv_id") %>'></asp:Label></ItemTemplate></asp:TemplateField>
                    <asp:TemplateField HeaderText="CONTEO"><ItemTemplate><asp:Label ID="lb_padron" runat="server" Text='<%# Eval("conteo") %>'></asp:Label></ItemTemplate></asp:TemplateField>
                    
                </Columns>
            </asp:GridView>
        </td>
        <td valign="top"><asp:Panel ID="Panel1" runat="server" Height="167px" Width="330px">

            <asp:GridView ID="gv_usuarios" runat="server" AutoGenerateColumns="False" 
                DataSourceID="SqlDataSource2">
            <AlternatingRowStyle BackColor="#F5E3CB" />
            <Columns>
                    <asp:TemplateField HeaderText="USUARIO"><ItemTemplate><asp:Label ID="lb_usuario" runat="server" Text='<%# Eval("usuario") %>'></asp:Label></ItemTemplate></asp:TemplateField>
                    <asp:TemplateField HeaderText="TOTAL REGISTRADO"><ItemTemplate><asp:Label ID="lb_registro" runat="server" Text='<%# Eval("conteo") %>'></asp:Label></ItemTemplate></asp:TemplateField>
                    
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:PacificStarBPOConnectionString %>" 
                SelectCommand="SELECT DISTINCT usuario , COUNT(usuario) AS conteo FROM    tbl_patriota WHERE     (Estado = 1) GROUP BY usuario ORDER BY conteo DESC" >
            </asp:SqlDataSource>
&nbsp;<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:PacificStarBPOConnectionString %>" 
                SelectCommand="SELECT cv_id, CAST(SUBSTRING(cv_id, 3, 6) AS INT) AS Expr3, COUNT(Padron) AS Conteo FROM  tbl_patriota WHERE (cv_id IN  (SELECT  cv_id   FROM  tbl_centrovotacion AS tv)) GROUP BY cv_id  ORDER BY Conteo DESC,Expr3">
            </asp:SqlDataSource>
            </asp:Panel>
            <br />
            
        </td>
        </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
    </table>
     </form>
    </div>
		<!-- end left hand main content -->
		
		
		<!-- start footer -->
		<div class="footer">
			<p>&copy; 2011 Pacific Star BPO</p>
		</div>
		<!-- end footer -->
	</div>
</div>
<div style="text-align: center; font-size: 0.75em;">&nbsp;
    </div>
   
    
         
</body>
</html>
